<template>
    <video
        ref="video"
		style="object-fit:cover;"
		width="100%"
        controls
    >
        <source :src="img" />
    </video>
</template>

<script>
export default {
 props: {
        img: {
          type: String,
          default: 'http://39.107.54.180/html/imooc-bilibili/public/img/video_bg_02.aa840151.png'
        }
    },
  data() {
    return {
      player: null // 用来存储当前 video
    }
  },
  mounted() { // 渲染视频
    this.player = this.$video(this.$refs.video)
  }
}
</script>
<style>
	.video-box {
	    padding-bottom: 56.25%;
	    width: 100%;
	    position: relative;
	}
</style>

